{
 "nbformat": 4,
 "nbformat_minor": 2,
 "metadata": {
  "language_info": {
   "name": "python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "version": "3.7.4-final"
  },
  "orig_nbformat": 2,
  "file_extension": ".py",
  "mimetype": "text/x-python",
  "name": "python",
  "npconvert_exporter": "python",
  "pygments_lexer": "ipython3",
  "version": 3,
  "kernelspec": {
   "name": "python37464bitbasecondaf58f680e650245d6af9156a7f17ac0fa",
   "display_name": "Python 3.7.4 64-bit ('base': conda)"
  }
 },
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "import rqdatac as rq\n",
    "import datetime\n",
    "rq.init('18225006201', 'mkq6412459')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "all_instruments=rq.all_instruments(type=\"CS\")\n",
    "stock_list=all_instruments['order_book_id']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "today=datetime.date.today().strftime(\"%Y-%M-%d\")\n",
    "price_panel=rq.get_price(stock_list,start_date='2010-01-01',enddate='',adjust_type=\"post\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "price_panel.to_pickle(\"price_panel.pkl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "<class 'pandas.core.panel.Panel'>\nDimensions: 9 (items) x 59 (major_axis) x 3959 (minor_axis)\nItems axis: open to limit_up\nMajor_axis axis: 2010-01-04 00:00:00 to 2010-04-01 00:00:00\nMinor_axis axis: 300275.XSHE to 600386.XSHG"
     },
     "metadata": {},
     "execution_count": 33
    }
   ],
   "source": [
    "price_panel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "'2020-00-10'"
     },
     "metadata": {},
     "execution_count": 43
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}